/**
 * @date: 2025/3/24
 * @author: 小红
 * @Description: 业务路由
 */

import { useBarComp } from '@/hooks/useBarComps';
import type { _RouteRecordRaw } from '@/router/types';
import { RouterView } from 'vue-router';

const menuRoutes: _RouteRecordRaw[] = [
	{
		path: '/home',
		name: 'home',
		component: () => import('@/views/HomeView.vue'),
		meta: {
			title: '首页',
			order: 1,
			icon: 'EachApp_shouye1',
			center: [useBarComp('CenterSearch')],
		},
	},
	{
		path: '/app',
		name: 'app',
		component: () => import('@/views/HomeView.vue'),
		meta: {
			title: '应用',
			order: 2,
			icon: 'EachApp_yingyong',
		},
	},
	{
		path: '/note',
		name: 'note',
		redirect: '/note/person',
		component: RouterView,
		meta: {
			title: '笔记',
			icon: 'EachApp_wj-bjb',
			order: 3,
		},
		children: [
			{
				path: '/note/person',
				name: 'person',
				component: () => import('@/views/note/person/NotePersonalOnly.vue'),
				meta: {
					title: '个人',
					icon: 'EachApp_geren',
					left: [],
					center: [useBarComp('CenterSearch')],
					right: [useBarComp('RightAdd')],
				},
			},
			{
				path: '/note/apply',
				name: 'apply',
				component: () => import('@/views/note/app/NoteAppOnly.vue'),
				meta: {
					title: '应用',
					icon: 'EachApp_yingyong1',
					center: [useBarComp('CenterSearch')],
				},
			},
			{
				path: '/note/share',
				name: 'share',
				component: () => import('@/views/note/share/NoteShareOnly.vue'),
				meta: {
					title: '共享',
					center: [useBarComp('CenterSearch')],
					icon: 'EachApp_gongxiang',
				},
			},
			{
				path: ':parentRoute/detail/:id',
				name: 'detail',
				component: () => import('@/views/note/detail/NoteBookDetail.vue'),
				meta: {
					title: '详情',
					icon: 'EachApp_wj-bjb',
					hidden: true,
					left: [useBarComp('LeftBack')],
					right: [useBarComp('RightAdd')],
				},
			},
		],
	},
	{
		path: '/im',
		name: 'im',
		redirect: '/im/all',
		meta: {
			title: '消息',
			icon: 'EachApp_xiaoxi',
			imType: 'all',
			right: [useBarComp('RightAdd')],
			order: 4,
		},
		component: RouterView,
		children: [
			{
				path: '/im/all',
				name: 'all',
				meta: {
					title: '消息',
					icon: 'EachApp_xiaoxi',
					hidden: true,
					right: [useBarComp('RightAdd')],
				},
				component: () => import('@/views/im/all/index.vue'),
			},
			{
				path: '/im/unread',
				name: 'unread',
				component: () => import('@/views/im/unread/index.vue'),
				meta: { title: '未读', icon: 'EachApp_weidu1', imType: 'unread' },
			},
			{
				path: '/im/mention',
				name: 'mention',
				component: () => import('@/views/im/mention/index.vue'),
				meta: { title: '@我', icon: 'EachApp_aite1', imType: 'mention' },
			},
			{
				path: '/im/create',
				name: 'create',
				component: () => import('@/views/im/create/index.vue'),
				meta: { title: '召集', icon: 'EachApp_wofaqide1', imType: 'create' },
			},
			{
				path: '/im/join',
				name: 'join',
				component: () => import('@/views/im/join/index.vue'),
				meta: { title: '参与', icon: 'EachApp_canyu', imType: 'join' },
			},
			{
				path: '/im/return',
				name: 'return',
				component: () => import('@/views/im/archive/index.vue'),
				meta: { title: '归档', icon: 'EachApp_guidang' },
			},
		],
	},
];

export default menuRoutes;
